package ch05_类与对象;

class Square{
	
}
class Triangle{
	
}

public class Painter {
	void draw(String str) {
		System.out.println("绘制字符串。");
	}
	void draw(Square s) {
		System.out.println("绘制矩形。");
	}
	void draw(Square s, int x,int y) {
		System.out.println("在指定坐标绘制矩形。");
	}
	void draw(int x,int y, Square s) {
		System.out.println("在指定坐标绘制矩形。");
	}
	void draw(Triangle t) {
		System.out.println("绘制三角形。");
	}
	public static void main(String[] args) {
		String str="123";
		Square s=null;
		Triangle t=null;
		int x=1,y=1;
		Painter painter =new Painter();
		painter.draw(str);
		painter.draw(s);
		painter.draw(s, x, y);
		painter.draw(x, y, s);
		painter.draw(t);
		
	}
}
